home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload Trio 2 / Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO / dir24 / bpq408.zip / WINBPQ.DOC < prev    next >
Text File  |  1994-11-05  |  5KB  |  183 lines

  1.         Using G8BPQ Switch with Windows Applications.
  2.  
  3.  
  4.  
  5. The BPQ Host mode interface cannot be used directly by Windows programs.
  6. So I have written a couple of modules to allow WIndows applications to 
  7. access the switch. They are BPQCODE.386 and BPQDLL.DLL
  8.  
  9.  
  10. BPQCODE.386
  11.  
  12. This is a Windows Virtual Device which converts calls from protected mode
  13. software, eg Windows Applications, to real mode, and passes them to BPQCODE.
  14. It will load automatically when Windows starts if you have already loaded
  15. BPQCODE. It should be in the \WINDOWS\SYSTEM directory 
  16.  
  17.  
  18. BPQDLL.DLL
  19.  
  20.  
  21. This module allows Windows applications to call the BPQ Host Mode API.
  22. The API expects most parameters in CPU Registers. This is inconvenient in
  23. high level languages, expecially Visual Basic. So BPQDLL uses pointers
  24. to integers for these parameters.
  25.  
  26. The following are the function definitions. These map more or less directly
  27. onto the corresponding API functions - see BPQHOST.DOC for full details of
  28. the BPQHost API.
  29.  
  30.  
  31. int FAR PASCAL GetFreeBuffs()
  32.  
  33.     Returns number of free buffers    (BPQHOST function 7 (part)).
  34.  
  35.  
  36. int FAR PASCAL RXCount(int Stream)
  37.  
  38.     Returns count of packets waiting on stream
  39.      (BPQHOST function 7 (part)).
  40.  
  41.  
  42. int FAR PASCAL TXCount(int Stream)
  43.  
  44.     Returns number of packets on TX queue for stream
  45.      (BPQHOST function 7 (part)).
  46.  
  47.  
  48. int FAR PASCAL MONCount(int Stream)
  49.  
  50.     Returns number of monitor frames available
  51.      (BPQHOST function 7 (part)).
  52.  
  53.  
  54. int FAR PASCAL GetCallsign(int stream, LPSTR callsign)
  55.  
  56.     Returns call connected on stream (BPQHOST function 8 (part)).
  57.  
  58.  
  59. int FAR PASCAL SessionControl(int stream, int command, int param)
  60.  
  61.     Send Session Control command (BPQHOST function 6)
  62.  
  63.  
  64. int FAR PASCAL SetAppl(int stream, int flags, int mask)
  65.  
  66.     Sets Application Mask and Flags for stream. (BPQHOST function 1)
  67.   
  68.  
  69. int FAR PASCAL SessionState(int stream, LPSTR state, LPSTR change)
  70.  
  71.     Get current Session State. Any state changed is ACK'ed
  72.     automatically. See BPQHOST functions 4 and 5.
  73.  
  74.  
  75. int FAR PASCAL SendMsg(int stream, LPSTR msg, int len)
  76.  
  77.     Send message go stream (BPQHOST Function 2)
  78.  
  79.  
  80. int FAR PASCAL SendRaw(int port, LPSTR msg, int len)
  81.  
  82.     Send RaW (KISS mode) frame to port (BPQHOST function 10)
  83.  
  84.  
  85. int FAR PASCAL GetMsg(int stream, LPSTR msg, LPINT len, LPINT count )
  86.  
  87.     Get message from stream. Returns length, and count of frames
  88.     still waiting to be collected. (BPQHOST function 3)
  89.  
  90.  
  91. int FAR PASCAL GetRaw(int stream, LPSTR msg, LPINT len, LPINT count )
  92.  
  93.  
  94.     Get Raw (Trace) data (BPQHOST function 11)
  95.  
  96.  
  97. int FAR PASCAL DecodeFrame(LPSTR msg, LPSTR buffer, int Stamp)
  98.  
  99.  
  100.     This is not an API function. It is a utility to decode a received
  101.     monitor frame into ascii text.
  102.  
  103.  
  104. int FAR PASCAL SetTraceOptions(long mask, int mtxparam, int mcomparam)
  105.  
  106.  
  107.     Sets the tracing options for DecodeFrame. Mask is a bit
  108.     mask of ports to monitor (ie 101 binary will monitor ports
  109.     1 and 3). MTX enables monitoring on transmitted frames. MCOM
  110.     enables monitoring of protocol control frames (eg SABM, UA, RR),
  111.     as well as info frames.
  112.  
  113.  
  114.  
  115. int FAR PASCAL FindFreeStream()
  116.  
  117.     Returns number of first unused BPQHOST stream. If none available,
  118.     returns 255. See API function 13.
  119.  
  120.  
  121. int FAR PASCAL AllocateStream(int stream)
  122.  
  123.     Allocate stream. If stream is already allocated, return nonzero.
  124.     Otherwise allocate stream, and return zero.
  125.  
  126.  
  127. int FAR PASCAL DeallocateStream(int stream)
  128.  
  129.     Release stream.
  130.  
  131.  
  132.  
  133. The following are Visual Basic function definitions for the above.
  134.  
  135.  
  136. Declare Function getfreebuffs Lib "bpqdll" () As Integer
  137.  
  138. Declare Sub getcallsign Lib "bpqdlL.dll" (ByVal Stream As Integer,
  139.    ByVal callsign As String)
  140.  
  141. Declare Sub SessionControl Lib "bpqdll.dll" (ByVal Stream As Integer,
  142.    ByVal Commnd As Integer, ByVal Opt As Integer)
  143.  
  144. Declare Function SessionState Lib "bpqdll.dll" (ByVal Stream As Integer,
  145.    state As Integer, change As Integer) As Integer
  146.  
  147. Declare Function SendMsg Lib "bpqdll.dll" (ByVal Stream As Integer,
  148.    ByVal Msg As String, ByVal length As Integer) As Integer
  149.  
  150. Declare Function SendRaw Lib "bpqdll.dll" (ByVal port As Integer,
  151.    ByVal Msg As String, ByVal length As Integer) As Integer
  152.  
  153. Declare Function GetMsg Lib "bpqdll.dll" (ByVal Stream As Integer,
  154.    ByVal Msg As String, length As Integer, MORE As Integer) As Integer
  155.  
  156. Declare Function GetRAW Lib "bpqdll.dll" (ByVal Stream As Integer,
  157.    ByVal Msg As String, length As Integer, MORE As Integer) As Integer
  158.  
  159. Declare Function RXCount Lib "bpqdll.dll" (ByVal Stream As Integer) As Integer
  160.  
  161. Declare Function TXCount Lib "bpqdll.dll" (ByVal Stream As Integer) As Integer
  162.  
  163. Declare Function MONCount Lib "bpqdll.dll" (ByVal Stream As Integer) As Integer
  164.  
  165. Declare Sub SetAppl Lib "bpqdll.dll" (ByVal Stream As Integer,
  166.    ByVal Flags As Integer, ByVal mask As Integer)
  167.  
  168. Declare Function DecodeFrame Lib "bpqdll.dll" (ByVal inpmsg As String,
  169.    ByVal outputmsg As String, ByVal TIMES As Integer) As Integer
  170.  
  171. Declare Sub SetTraceOptions Lib "bpqdll.dll" (ByVal MMASK As Long,
  172.    ByVal MTX As Integer, ByVal MCOM As Integer)
  173.  
  174. Declare Function FindFreeStream Lib "bpqdll.dll" () As Integer
  175.  
  176. Declare Sub DeallocateStream Lib "bpqdll.dll" (ByVal Stream As Integer)
  177.  
  178.  
  179.  
  180. John Wiseman
  181. 1/10/94.
  182. revised 5/11/94.
  183.